package com.om39a.plm.parser;

import java.util.ArrayList;

import org.apache.log4j.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

/**
 * @author om39a
 * 
 */
public class ParserFollowingPage extends PLMParser {
	static Logger logger = Logger.getLogger(ParserFollowingPage.class);

	public void parse(String pageContent, ArrayList<String> following) {
		logger.info("Entring into parse - pageContent - " + following);
		Document doc = Jsoup.parse(pageContent);
		Elements followerstableElement = doc.select("tr[class=follow]");
		for (Element element : followerstableElement) {
			following.add(element.select("td[class=username]").text());
		}
		logger.info("Exiting from parse");
	}
}
